import axios from '../../axios'

/* 
 * 用户管理模块
 */

export const queryDetail = (data) => {
    return axios({
        url: '/kysj/user/user/findById?userId='+data,
        method: 'get',
    })
}


// 查询总量
export const count = () => {
    return axios({
        url: '/kysj/user/user/count',
        method: 'get',
    })
}

// 添加用户
export const addUser = (data) => {
    return axios({
        url: '/kysj/user/user/addUser',
        method: 'put',
        data
    })
}

// 按用户名查询
export const findByName = (data) => {
    return axios({
        url: '/kysj/user/user/findByName?userName='+data,
        method: 'get',
    })
}

// 保存
export const updateUser = (data) => {
    return axios({
        url: '/kysj/user/user/updateUser',
        method: 'post',
        data
    })
}
// 删除
export const batchDelete = (data) => {
    return axios({
        url: '/kysj/user/user/delete?userId=' + data,
        method: 'delete',
    })
}
// 分页查询
export const findByPage = (page,pageSize) => {
    return axios({
        url: '/kysj/user/user/findByPage/'+page+'/'+pageSize+'/',
        method: 'get'
    })
}

// 获取用户所拥有的权限信息
export const findUserRight = (userId) => {
    return axios({
        url: '/kysj/user/user/findUserRight?userId=' + userId,
        method: 'get',
    })
}